//
//  DKAuthBaseStepSubView.m
//  DanKU
//
//  Created by 吴斌 on 2023/10/29.
//

#import "DKAuthBaseStepSubView.h"
@interface DKAuthBaseStepSubView()
@property (nonatomic, strong)UIImageView * dk_AuthBaseStepBgImgView;
@property (nonatomic, strong)UIImageView * dk_AuthBaseStepIconImgView;
@property (nonatomic, strong)UILabel * dk_AuthBaseStepLab;
@property (nonatomic, strong)UILabel * dk_AuthBaseStepMoneyLab;
@end
@implementation DKAuthBaseStepSubView
-(instancetype)init{
    if(self == [super init]){
        [self dk_addSubView];
    }
    return self;
}
- (void)dk_addSubView{
    self.dk_AuthBaseStepBgImgView = [[UIImageView alloc] init];
    self.dk_AuthBaseStepBgImgView.userInteractionEnabled = YES;
    [self addSubview:self.dk_AuthBaseStepBgImgView];
    [self.dk_AuthBaseStepBgImgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(@(DK_IsWidthScale(0)));
        make.right.equalTo(@(-DK_IsWidthScale(0)));
        make.top.equalTo(@(DK_IsWidthScale(0)));
        make.height.equalTo(@(DK_IsWidthScale(70)));
    }];
    self.dk_AuthBaseStepIconImgView = [[UIImageView alloc] init];
    self.dk_AuthBaseStepIconImgView.userInteractionEnabled = YES;
    [self addSubview:self.dk_AuthBaseStepIconImgView];
    [self.dk_AuthBaseStepIconImgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self);
        make.top.equalTo(@(DK_IsWidthScale(15)));
        make.width.equalTo(@(DK_IsWidthScale(16)));
        make.height.equalTo(@(DK_IsWidthScale(16)));
    }];
    self.dk_AuthBaseStepLab = [[UILabel alloc] init];
    self.dk_AuthBaseStepLab.textColor = DK_Hex(@"#333333");
    self.dk_AuthBaseStepLab.font = DK_FONT_Medium(14);
    self.dk_AuthBaseStepLab.textAlignment = NSTextAlignmentCenter;
    [self addSubview:self.dk_AuthBaseStepLab];
    [self.dk_AuthBaseStepLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(@(DK_IsWidthScale(0)));
        make.right.equalTo(@(DK_IsWidthScale(0)));
        make.top.equalTo(self.dk_AuthBaseStepIconImgView.mas_bottom).offset(DK_IsWidthScale(1));
        make.height.equalTo(@(DK_IsWidthScale(20)));
    }];
    UIImageView * dk_AuthBaseStepMoneyImgView = [[UIImageView alloc] init];
    dk_AuthBaseStepMoneyImgView.image = DK_GetImage(@"dk_AuthStepBtnBg");
    dk_AuthBaseStepMoneyImgView.userInteractionEnabled = YES;
    [self addSubview:dk_AuthBaseStepMoneyImgView];
    [dk_AuthBaseStepMoneyImgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self);
        make.top.equalTo(self.dk_AuthBaseStepBgImgView.mas_bottom).offset(-DK_IsWidthScale(11));
        make.height.equalTo(@(DK_IsWidthScale(21)));
    }];
    self.dk_AuthBaseStepMoneyLab = [[UILabel alloc] init];
    self.dk_AuthBaseStepMoneyLab.textColor = DK_Hex(@"FFFFFF");
    self.dk_AuthBaseStepMoneyLab.font = DK_FONT_Regular(15);
    self.dk_AuthBaseStepMoneyLab.textAlignment = NSTextAlignmentCenter;
    self.dk_AuthBaseStepMoneyLab.text = [NSString stringWithFormat:@"+？？？"];
    [dk_AuthBaseStepMoneyImgView addSubview:self.dk_AuthBaseStepMoneyLab];
    [self.dk_AuthBaseStepMoneyLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self);
        make.top.equalTo(@(DK_IsWidthScale(0)));
        make.bottom.equalTo(@(DK_IsWidthScale(0)));
        make.left.equalTo(@(DK_IsWidthScale(12)));
        make.right.equalTo(@(-DK_IsWidthScale(12)));
    }];
}
-(void)setAuthBaseStepType:(AuthBaseStepType)authBaseStepType{
    _authBaseStepType = authBaseStepType;
    if(_authBaseStepType == AuthBaseStepTypeBasic){
        self.dk_AuthBaseStepIconImgView.image = DK_GetImage(@"dk_AuthBasic");
        self.dk_AuthBaseStepLab.text = @"Basic";
    }else if (_authBaseStepType == AuthBaseStepTypeContact){
        self.dk_AuthBaseStepIconImgView.image = DK_GetImage(@"dk_AuthContact");
        self.dk_AuthBaseStepLab.text = @"Contact";
    }else if (_authBaseStepType == AuthBaseStepTypeBankCard){
        self.dk_AuthBaseStepIconImgView.image = DK_GetImage(@"dk_AuthBankCard");
        self.dk_AuthBaseStepLab.text = @"Bankcard";
    }
}
-(void)setIsCurrentSelect:(BOOL)isCurrentSelect{
    _isCurrentSelect = isCurrentSelect;
    if(_isCurrentSelect){
        self.dk_AuthBaseStepBgImgView.image = DK_GetImage(@"dk_AuthStepSelectHeadBg");
        self.dk_AuthBaseStepMoneyLab.text = [NSString stringWithFormat:@"+%@",_authBaseStepAmount];
    }else{
        self.dk_AuthBaseStepBgImgView.image = DK_GetImage(@"dk_AuthStepUnSelectHeadBg");
        self.dk_AuthBaseStepMoneyLab.text = [NSString stringWithFormat:@"+???"];
    }
}
@end
